<h2 class="contentTitle">推广类型管理</h2>
<form action="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=ajaxManagerType';?>" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone)">
<div class="pageContent">
	<div layouth="97" class="pageFormContent nowrap" style="height: 376px; overflow: auto;">
        <dl>
            <dt>操作类型：</dt>
            <dd style="width: 330px">
                <select class="combox" name="manager_type_id" ref="parent_ad_type_id" refUrl="<?php echo SITE_URL . 'index.php?c='.$controller;?>&a=ajaxGetType&manager_type_id={value}">
                    <option value="0">请选择类型</option>
                    <option value="1">添加父类</option>
                    <option value="2">添加子类</option>
                    <option value="3">修改父类</option>
                    <option value="4">修改子类</option>
                    <option value="5">删除全部</option>
                </select>
                <span class="inputInfo">添加，修改，删除操作</span>
            </dd>
        </dl>
        <dl>
            <dt>选择类型：</dt>
            <dd style="width: 330px">
                <select class="combox" name="parent_ad_type_id" id="parent_ad_type_id">
                    <option value="0">请正确填写一下类型</option>
                </select>
                <span class="inputInfo">请选择父类型，默认为新建父类型</span>
            </dd>
        </dl>
        <dl>
            <dt>推广类型：</dt>
            <dd style="width: 330px">
                <input type="text" name="type_name" size="20" class="required textInput valid">
                <span class="inputInfo">请选填写类型名称，言简意赅</span>
            </dd>
        </dl>
	</div>
	<div class="formBar">
		<ul>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit">确认</button></div></div></li>
			<li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li>
		</ul>
	</div>
</div>
</form>
<script type="text/javascript">
    //动态加载上传插件
    <?php $timestamp = time();?>
    $(function() {
        $('#file_upload').uploadify({
            'onInit': function(){},
            'formData'     : {
                'type' : 'ad',
                'timestamp' : '<?php echo $timestamp;?>',
                'token'     : '<?php echo md5(MD5_CODE . $timestamp);?>'
            },
            'simUploadLimit':1,
            'swf'      : '<?php echo DWZ_URL; ?>uploadify/scripts/uploadify.swf',
            'uploader' : '<?php echo SITE_URL . 'index.php?c='.$controller.'&a=adPictureUpload';?>',
            'buttonText' : '上传图片',
            'fileSizeLimit':'2018KB',
            'fileTypeDesc':'*.jpg;*.jpeg;*.gif;*.png;',
            'fileTypeExts':'*.jpg;*.jpeg;*.gif;*.png;',
            'auto':true,
            'multi':false,
            'onUploadError' : function(file,errorCode,errorMsg,errorString,swfuploadifyQueue){
                //alert(errorMsg);//上传文件出错是触发（每个出错文件触发一次）
                alertMsg.info(errorMsg);
            },
            'onUploadSuccess':function(file,data,response){

                var data_str = data.replace("\n\n","");
                var error_str = data_str.substring(0,5);

                if(error_str == "error"){
                    alertMsg.error('上传图片异常，请联系管理员检查！');
                }else{
                    $('#curr_picture').attr('src',data_str+'?'+Math.random()).attr('original',data_str);
                    $('input[name=picture]').val(data_str);
                }
            },
            'onSelect': function (event, queueID, fileObj)
            {
                $("#file_upload").uploadify('settings','formData',{curr_picture:$('input[name=picture]').val()})
            }
        });
    });
</script>